package com.example;

import com.example.beans.CDPlayer;
import com.example.beans.DVDPlayer;
import com.example.beans.KTVPlayer;
import com.example.beans.MusicBox;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Application {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml");
        CDPlayer cdPlayer = context.getBean(CDPlayer.class);
        cdPlayer.play();
        DVDPlayer dvdPlayer = context.getBean(DVDPlayer.class);
        dvdPlayer.play();
        KTVPlayer ktvPlayer = context.getBean(KTVPlayer.class);
        ktvPlayer.play();
        MusicBox musicBox = context.getBean(MusicBox.class);
        musicBox.showBox();

    }
}
